<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('TemplateFooter/index')}">表尾列表</a></li>
        <li><a href="{:url('TemplateFooter/add')}">新建表尾</a></li>
    </ul>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('TemplateFooter/sort')}">
        <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateFooter/sets',array('status'=>1))}" data-subcheck="true">启用
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateFooter/sets',array('status'=>2))}" data-subcheck="true">停用
            </button>
        </div>
        
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">{:lang('SORT')}</th>
                <th width="150">表尾ID</th>
                <th>创建日期</th>
                <th>创建人</th>
				<th>表尾名称</th>
                <th>字段数量</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="vo">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                               value="{$vo.footer_id}"></td>
                    <td><input name='sort[{$vo.footer_id}]' class="input input-order mr5" type='text' size='3'
                               value='{$vo.sort}'></td>
                    <td>{$vo.footer_id}</td>
					<td>{$vo.create_time}</td>
                    <td>{$vo.appuser.realName}</td>
                    <td>{$vo.name}</td>
                    <td>{$vo.num}</td>
                    <td>
					    <if condition="$vo['status'] eq 1">
					        <a href="{:url('TemplateFooter/set',array('footer_id'=>$vo['footer_id'],'status'=>2))}" class="js-ajax-dialog-btn" data-msg="确定停用吗？">停用</a>
					    <else />
					        <a href="{:url('TemplateFooter/set',array('footer_id'=>$vo['footer_id'],'status'=>1))}" class="js-ajax-dialog-btn" data-msg="确定启用吗？">启用</a>
					    </if>
                       
						<a href="javascript:toEdit({$vo.footer_id})">编辑</a>
						<a href="javascript:look({$vo.footer_id})">预览</a>
                     
                    </td>
                </tr>
            </foreach>
            </tbody>
            <tfoot>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">{:lang('SORT')}</th>
                <th width="150">表尾ID</th>
                <th>创建日期</th>
                <th>创建人</th>
                <th>表尾名称</th>
                <th>字段数量</th>
                <th width="200">{:lang('ACTIONS')}</th>
            </tr>
            </tfoot>
        </table>
        <div class="table-actions">
             <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateFooter/sets',array('status'=>1))}" data-subcheck="true">启用
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('TemplateFooter/sets',array('status'=>2))}" data-subcheck="true">停用
            </button>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    function toEdit(id){
        //打开新增窗口
        openIframeLayer("/teacher/Template_footer/edit/id/"+id, '编辑', {
            area: ['800px', '600px'],
        });
    }
    function look(id){
        //打开新增窗口
        openIframeLayer("/teacher/Template_footer/look/id/"+id, '预览', {
            area: ['600px', '600px'],
        });
    }
</script>
</body>
</html>